<?php

/**
 * sfGuardUserProfile form.
 *
 * @package    travelbug
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormTemplate.php 10377 2008-07-21 07:10:32Z dwhittle $
 */
class sfGuardUserProfileForm extends BasesfGuardUserProfileForm
{
  public function configure()
  {
  	$this->setWidgets(array(
      'id'                  => new sfWidgetFormInputHidden(),
      'user_id'             => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser', 'add_empty' => false)),
      'first_name'          => new sfWidgetFormInput(),
      'last_name'           => new sfWidgetFormInput(),
      'email'               => new sfWidgetFormInput(),
      'company'             => new sfWidgetFormInput(),
      'company_description' => new sfWidgetFormInput(),
      'address'             => new sfWidgetFormInput(),
      'address2'            => new sfWidgetFormInput(),
      'city'                => new sfWidgetFormInput(),
      'country'             => new sfWidgetFormInput(),
      'state'               => new sfWidgetFormInput(),
      'zip'                 => new sfWidgetFormInput(),
      'phone'               => new sfWidgetFormInput(),
      'user_type'           => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'                  => new sfValidatorPropelChoice(array('model' => 'sfGuardUserProfile', 'column' => 'id', 'required' => false)),
      'user_id'             => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id')),
      'first_name'          => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'last_name'           => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'email'               => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'company'             => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'company_description' => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'address'             => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'address2'            => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'city'                => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'country'             => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'state'               => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'zip'                 => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'phone'               => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'user_type'           => new sfValidatorInteger(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('sf_guard_user_profile[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::configure();
  	
  }
}
